package com.itheima.exception;

public class ExceptionDemo {
    public void show1() {
        System.out.println("数字转换异常");
        String s = "abc";
        int i = Integer.parseInt(s);
    }

    public static void show2() {
        System.out.println("数字异常");
        int i = 3 / 0;
    }

    public void show3() throws MyException {
        System.out.println("自定义异常");
        throw new MyException();
    }

    public class MyException extends Exception {
    }
}
